package com.fan.shop.views.bean;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;

import com.fan.shop.domain.Category;
import com.fan.shop.services.CategoryService;


@ManagedBean(name="test")
@SessionScoped
public class TestBean {

	@ManagedProperty(value = "#{categoryService}")
	private CategoryService categoryService;
	
	private List<Category> categoryList;

	public CategoryService getCategoryService() {
		return categoryService;
	}

	public void setCategoryService(CategoryService categoryService) {
		this.categoryService = categoryService;
	}

	public List<Category> getCategoryList() {
		categoryList=categoryService.getAllCategories();
		return categoryList;
	}

	public void setCategoryList(List<Category> categoryList) {
		this.categoryList = categoryList;
	}
	
	
	
	

}
